html {
	overflow: hidden;
}

html.badscroll {
	overflow: auto;
}

body  {
	margin:0px;
	padding:0px;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* this prevents the search input field from "jumping" on the first search */
input:focus {
	outline:none;
}

/* Kill this fix. Apparently causes some samsung keyboards do not let you type into things if this setting is enabled
 * So we'll have to live with the stupid overlay. Which hides the spinner
 * Webkit has no bugs */
/*input {*/
	/*[> Kills stupid overlay hiding spinner on several ICS phones <]*/
	/*[> see http://stackoverflow.com/questions/9005550/input-elements-on-android-4-x-can-not-be-styled-when-focused <]*/
	/*-webkit-user-modify: read-write-plaintext-only;*/
/*}*/

img {
	border:0px;
}

div {
	margin:0px;
	padding:0px;
}

header {
	position:absolute;
	top:0px;
	left:0px;
	width:100%;
	height: 52px;
}

.badscroll header {
	position:fixed;
	z-index:30000;
}

#savedPages,
#history,
#settings,
#searchresults,
#langlinks,
#about-page-overlay,
#nearby-overlay {
	background-color:white;
	width:100%;
	height:100%;
	display:none;
}

#searchresults a {
	color: black;
}

/*#savedPagesList, #historyList, #resultList, #langList, #about-page-content*/
.scroller {
	position:absolute;
	top:52px;
	width: 100%;
	bottom: 0px;
	/* See http://stackoverflow.com/questions/7808110/css3-property-webkit-overflow-scrollingtouch-error */
	-webkit-transform: translate3d(0, 0, 0); 
}

/* fix for cleaner scrolling on non-android see commit f130a3e3c823309d3e5d8cc57d202e67f3631fce */
.iOS .scroller {
	-webkit-overflow-scrolling: touch;
	overflow-y: auto;
}

.scroller > * {
	/* See http://stackoverflow.com/questions/7808110/css3-property-webkit-overflow-scrollingtouch-error */
    -webkit-transform: translateZ(0px);
}

.badscroll .scroller {
	position:relative;
	top:52px;
	width: 100%;
}

.android .scroller {
	/* No bottom toolbar */
	bottom: 0px;
}

.winphone .scroller {
	overflow-y: auto;
}

#map {
	position: absolute;
	top: 52px;
	bottom: 0px;
	left: 0px;
	right: 0px;
}

.android #map {
	bottom: 0px; /* no toolbar */
}

#content {
	display:block;
}

.badscroll #content {
	position:relative;
}

#content.scroller {
	bottom: 52px;
}

.nativeMenu #content.scroller {
	bottom: 0;
}

#main {
	padding: 8px;
}

.listItemContainer {
	display: -webkit-box;
	display: -moz-box;
	display: box;
	whitespace: no-wrap;
	border-bottom:1px solid #ddd;
	width:100%;
	position: relative;
}

.listItem {
	padding-top:12px;
	padding-bottom:12px;
	height: 22px;
	line-height: 22px;
	width: 100%;
	display: block;
}

.listItem.active,
.deleteButton.active {
	background-color: #aff6ff;
}

.iconSavedPage,
.iconHistory,
.iconSearchResult {
	background: url(image/spr.png) -49px -100px no-repeat;
	background-size: 160px 240px;
	height: 24px;
	left: 8px;
	position: absolute;
	top: 10px;
	width: 24px;
}

.iconHistory {
	background-position: -102px -100px;
}

.iconSearchResult {
	background-position: -100px -100px;
}

.listItem .text {
	position: absolute;
	left: 40px;
	right: 16px;
	white-space:nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
}

.listItem .text.deleteEnabled {
	right: 58px;
}

.deleteButton {
	position:absolute;
	background: url(image/spr.png) 9px -95px no-repeat;
	background-size: 160px 240px;
	top: 4px;
	bottom: 4px;
	right: 0;
	width: 44px;
	border-left: 1px solid #ddd;
}

button#search
{
	position: absolute;
	top: 8px;
	right: 8px;
	background: url(image/spr.png) -43px 5px no-repeat;
	background: url(image/spr.png) -43px 5px no-repeat,
	-webkit-gradient(linear, 0% 0%, 0% 100%, from(#777), color-stop(0.25, #333));
	background: url(image/spr.png) -43px 5px no-repeat,
	-moz-linear-gradient(#777 0%, #333 25%);
	background: url(image/spr.png) -43px 5px no-repeat,
	-ms-linear-gradient(#777 0%, #333 25%);
	background-size: 160px 240px;
	height: 37px;
	width: 40px;
	border: 1px solid #333;
	border-radius: 0px 5px 5px 0px;
}

#search.active {
	background: url(image/spr.png) -43px 5px no-repeat;
	background: url(image/spr.png) -43px 5px no-repeat,
		-webkit-gradient(linear, 0% 0%, 0% 100%, from(#444), color-stop(0.25, #666));
	background: url(image/spr.png) -43px 5px no-repeat,
		-moz-linear-gradient(#444 0%, #666 25%);
	background: url(image/spr.png) -43px 5px no-repeat,
		-ms-linear-gradient(#444 0%, #666 25%);
	background-size: 160px 240px;
}

#search.inProgress {
	background: url(image/spr.png) -130px -131px no-repeat;
	background: url(image/spr.png) -130px -131px no-repeat,
		-webkit-gradient(linear, 0% 0%, 0% 100%, from(#777), color-stop(0.25, #333));
	background: url(image/spr.png) -130px -131px no-repeat,
		-moz-linear-gradient(#777 0%, #333 25%);
	background: url(image/spr.png) -130px -131px no-repeat,
		-ms-linear-gradient(#777 0%, #333 25%);
	background-size: 160px 240px;
}

#search.inProgress.active {
	background: url(image/spr.png) -130px -131px no-repeat;
	background: url(image/spr.png) -130px -131px no-repeat,
		-webkit-gradient(linear, 0% 0%, 0% 100%, from(#444), color-stop(0.25, #666));
	background: url(image/spr.png) -130px -131px no-repeat,
		-moz-linear-gradient(#444 0%, #666 25%);
	background: url(image/spr.png) -130px -131px no-repeat,
		-ms-linear-gradient(#444 0%, #666 25%);
}

#searchParam {
	position: absolute;
	height: 29px;
	left: 45px;
	right: 45px;
	top: 6px;
	border: none;
	background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ddd),
		color-stop(0.2, #fff), color-stop(0.8, #fff), to(#eee));
	background: -moz-linear-gradient(#ddd 0%, #fff 20%, #fff 80%, #eee 100%);
	background: -ms-linear-gradient(#ddd 0%, #fff 20%, #fff 80%, #eee 100%);
	font-size: 18px;
	padding: 4px 28px 2px 4px;
	border: 1px solid #333;
	margin: 2px;
	z-index: 2;
	border-radius: 0; /* override for iphone where default is curvy */
}

#searchParam:focus,
#searchParam.active {
	margin: 0;
	border: 3px solid #f86600;
}

#searchParam,
#searchParam:focus,
#searchParam.active {
	/* This overrides the default looks of type=search on Apple WebKit */
	-webkit-appearance: none;
	box-sizing: content-box;
}

#clearSearch {
	position:absolute;
	top:12px;
	right:47px;
	z-index:2;
	display:none;
	background: url(image/spr.png) 2px 2px no-repeat;
	background-size: 160px 240px;
	height: 30px;
	width: 30px;
	visibility: hidden;
}

#about-page-content,
.android-2 .nativeMenu #main,
.android-2 .nativeMenu #searchresults .scroller,
#searchresults .scroller {
	margin-bottom: 52px;
}

.nativeMenu #main,
.nativeMenu #about-page-content,
.nativeMenu #searchresults .scroller {
	margin-bottom: 0;
}

.badscroll #clearSearch {
	position:fixed;
}

.spinner {
	background: url(image/spinner.gif) no-repeat;
	width:24px;
	height: 24px;
	position: absolute;
	top: 15px;
	right: 52px;
	z-index: 3;
	display: none;
}

.titlebarIcon {
	position: absolute;
	top: 8px;
	left: 8px;
	background: url(image/button-light-wiki.png) no-repeat;
	background: url(image/button-light-wiki.png) no-repeat,
		-webkit-gradient(linear, 0% 0%, 0% 100%, from(#777), to(#444));
	background: url(image/button-light-wiki.png) no-repeat,
		-moz-linear-gradient(#777 0%, #444 100%);
	background: url(image/button-light-wiki.png) no-repeat,
		-ms-linear-gradient(#777 0%, #444 100%);
	background-size: 40px;
	height: 37px;
	width: 40px;
	border: 1px solid #333;
	border-radius: 5px 0px 0px 5px;	
}

.titlebarIcon.active {
	background: url(image/button-light-wiki.png) no-repeat;
	background: url(image/button-light-wiki.png) no-repeat,
		-webkit-gradient(linear, 0% 0%, 0% 100%, from(#444), to(#777));
	background: url(image/button-light-wiki.png) no-repeat,
		-moz-linear-gradient(#444 0%, #777 100%);
	background: url(image/button-light-wiki.png) no-repeat,
		-ms-linear-gradient(#444 0%, #777 100%);
}

#wHolder {
	display:inline-block;
	margin-top:7px;
}

#searchFormHolder {
	white-space:nowrap;
	margin-left:5px;
	margin-top:7px;
}

.titlebar {
	display: -webkit-box;
	display: -moz-box;
	display: box;
	background: #4f4f4f;
	background: -webkit-gradient(linear, left top, left bottom, from(#5F5F5F), to(#4F4F4F));
	background: -moz-linear-gradient(#5F5F5F 0%, #4F4F4F 100%);
	background: -ms-linear-gradient(#5F5F5F 0%, #4F4F4F 100%);
	padding: 5px;
	height: 42px;
}

.titlebar > div:first-child {
	-webkit-box-flex: 1;
	-moz-box-flex: 1;
	box-flex: 1;
	text-shadow: #222 1px 1px 1px;
	font-size: 18px;
	margin-left: 6px;
}

.titlebarItem {
	margin-top:12px;
	padding-left: 32px;
}

.closeButton.active, .cleanButton.active {
	background-color: #666;
}

.closeButton {
	background: url(image/button-dark-back.png) 6px 11px no-repeat;
	background-size: 20px 31px;
	height: 52px;
	margin-top: 0px;
	position: absolute;
	left: 0;
	top: 0;
	width: 44px;
	border: 0;
}

.cleanButton {
	background: url(image/button-light-close.png) 6px 10px no-repeat;
	background-size: 32px;
	height: 52px;
	margin-top: 0px;
	position: absolute;
	right: 0;
	top: 0;
	width: 44px;
	border: 0;
	border-left: 1px solid #777;
}

.titlebar div {
    /*
    border-left:1px solid #666;
    border-right:1px solid #000;
    */
    color:white;
}

#settingsList .item {
	list-style: none;
	border-bottom:1px solid #ddd;
	padding: 12px 16px 12px 16px;
}
#settingsList .item label {
	font-size:16px;
}
#settingsList .item p {
	color: #aaa;
	font-size: 13px;
}

#settingsList .item input[type="checkbox"]:checked {
	background-position: 0px -160px;
}

#settingsList .item select {
	width: 100%;
	height: 32px;
	-webkit-appearance: none;
	background: url(image/select.png) no-repeat;
	background-position: right;
	background-size: 32px;
	border: none;
	overflow: hidden;
	top: 22px;
	font-size: 14px;
	padding-left: 0px;
}

body[dir=rtl] #settingsList .item select {
	background-position: left;
}

#settingsList .item select:focus {
	outline: none;
}

.error-overlay {
	background: white;
	background-image: url(image/globe-bg.jpg);
	background-position: top left;
	background-repeat: no-repeat;
	background-size: 140px 325px;
	color: black;
	font-family: "Droid Sans", "Helvetica", sans-serif;
	padding-left: 120px;
	padding-top: 20px;
	padding-right: 20px;
	font-size: 20px;
	padding-bottom: 40px;
	margin-left: -8px;
}

#about-page-overlay {
	padding-top: 10px;
	background: white;
	color: DarkGrey;
	font-family: "Droid Sans", "Helvetica", sans-serif;
}

#about-page-content {
	text-align: center;	
}

#about-version {
	font-size: 30px;
	color: Black;
	font-variant: small-caps;
}

#about-license {
	font-size: 10px;
}

/* Web, iOS menu */
#menu {
	position: absolute;
	height: 52px;
	bottom: 0;
	left: 0;
	right: 0;
	background: #4f4f4f;
	background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#777), color-stop(0.75, #333));
	background: -moz-linear-gradient(#777 0%, #333 75%);
	background: -ms-linear-gradient(#777 0%, #333 75%);
	padding: 0;
	margin: 0;
	text-align: center;
}

#menu button {
	display: inline-block;
	border: none;
	background: none;
	padding: 0px 2px;
	margin: 0;
}

#menu button span {
	display: inline-block;
	width: 48px;
	height: 48px;
	background-size: 48px 48px;
	background-position: center;
	background-repeat: no-repeat;
	vertical-align: center;
	text-align: center;
}

#menu button:active {
	background-image: -webkit-gradient(radial, center center, 8, center center, 24,
		from(white), to(rgba(255,255,255,0)));
	background-image: -moz-radial-gradient(center, closest-side, white 25%, rgba(255,255,255,0) 100%);
}

/* iOS bottombar iCons */

#go-back span {
	background: url(image/ios/toolbar-back.png);
}

body[dir=rtl] #go-back span {
	background: url(image/ios/toolbar-forward.png);
}

#go-forward span {
	background: url(image/ios/toolbar-forward.png);
}

body[dir=rtl] #go-forward span {
	background: url(image/ios/toolbar-back.png);
}

#read-in span {
	background: url(image/ios/toolbar-language.png);
}

#page-actions span {
	background-image: url(image/ios/toolbar-output.png);
}

#list-actions span {
	background: url(image/ios/toolbar-sources.png);
}

#view-settings span {
	background: url(image/ios/toolbar-settings.png);
}

/* For web simulation of iOS action sheets */
.actionsheet {
	background: #444;
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index:40001;
	padding: 16px;
}

.actionsheet-bg {
	background: rgba(0, 0, 0, 0.5);
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	z-index:40000;
}

.actionsheet button {
	width: 100%;
	height: 48px;
	margin: 8px 0px;
	font-size: 24px;
	border-radius: 8px;
}

.actionsheet button.destructive {
	background: #a22;
}

.actionsheet button.cancel {
	background: #888;
}


/* Blackberry Playbook menus */
.playbook-menu {
	background: rgba(64, 64, 64, 0.9);
	position: absolute;
	top: 56px;
	right: 8px;
	width: 240px;
	border: solid 2px #888;
	border-radius: 8px;
	z-index:40001;
	padding: 16px;
	-webkit-box-shadow: 0 2px 5px 0px #888;
}

.playbook-menu-bg {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	z-index:40000;
}

.playbook-menu button {
	width: 100%;
	height: 48px;
	margin: 0px 0px;
	font-size: 16px;
	font-weight: normal;
	color: white;
	background: none;
	-webkit-appearance: none;
	border: none;
	border-top: solid 1px #888;
}

.playbook-menu button:first-child {
	border: none;
}

.didYouMeanLabel {
	color: red;
}

.didYouMeanResult {
	color: blue;
	font-style: italic;
}

@media only screen and (min-width: 640px) {
	.goodscroll header {
		width: 320px;
		left: inherit;
	}
	.goodscroll.android header {
		/* @fixme add menu/actionbar */
		width: 100%;
	}
	.goodscroll #menu {
		top: 0;
		bottom: inherit;
		left: 320px;
		text-align: right;
		background: -webkit-gradient(linear, left top, left bottom, from(#5F5F5F), to(#4F4F4F));
		background: -moz-linear-gradient(#5F5F5F 0%, #4F4F4F 100%);
		background: -ms-linear-gradient(#5F5F5F 0%, #4F4F4F 100%);
	}
	#content.scroller {
		bottom: 0px;
	}
	#about-page-content,
	#main,
	#searchresults .scroller {
		margin-bottom: 0;
	}
	.goodscroll #content {
		position: absolute;
		width: auto;
	}
	.goodscroll.overlay-open #content {
		left: 320px;
	}
	.goodscroll #savedPages,
	.goodscroll #history,
	.goodscroll #settings,
	.goodscroll #searchresults,
	.goodscroll #langlinks {
		width: 320px;
	}
	.goodscroll .scroller {
		bottom: 0px;
		width: 320px;
	}
	.goodscroll #map {
		bottom: 0px; /* no toolbar */
	}
}

.iOS #menu .disabled {
	opacity: 0.1;
}

.disabled.listItemContainer .text{
	color: #ccc;
}

.android .scroller, /* without this content not visible until a scroll event */
.android .scroller > * {
	-webkit-transform: none; /* in ICS this causes lots of problems with scrolling */
}

/* in ICS it is not possible to scroll vertically across tables so undo rule in beta_common.css */
.android table {
	overflow-x: hidden;
	-webkit-overflow-scrolling: none;
}

/* on ios lets no rely on scrollable divs and instead make use of position fixed which is supported
the scrollable divs seem to be giving us lots of bugs
*/
.android-4 header {
	position: fixed;
	z-index: 2;
}

#page-footer {
	border-top: 1px #ccc solid;
	padding: 10px;
	text-align: center;
	display: none; /* Initially hidden */
}

#page-footer span {
	display: block;
	margin-bottom: 5px;
}

.mw-cite-backlink {
	display: none;
}

.full-modal-overlay {
	z-index: 999;
	position:absolute;
	top: 0px;
	bottom: 0px;
	left: 0px;
	right: 0px;
	background-color: White;
}

#migrating-saved-pages-overlay {
	display: none;
}

.migration-ready #migrating-saved-pages-overlay {
	display: -webkit-box;
	display: -moz-box;
	display: box;
	-webkit-box-orient: vertical;
	-moz-box-orient: vertical;
	box-orient: vertical;
	-webkit-box-pack: center;
	-moz-box-pack: center;
	box-pack: center;
	text-align: center;

	font-size: 18px;
}

.leaflet-marker-pane,
.leaflet-shadow-pane,
.leaflet-overlay-pane {
	/* hack to work around https://github.com/CloudMade/Leaflet/issues/335 */
    -webkit-transform: translateZ(0px);
}

/* RTL section icons */
body[dir=rtl] .section_heading button
{
	float: left;
}

body[dir=rtl]  .iconSavedPage,
body[dir=rtl]  .iconHistory,
body[dir=rtl]  .iconSearchResult {
	right: 8px;
	left: auto;
}

body[dir=rtl] .listItem .text {
	right: 40px;
	left: 16px;
}

body[dir=rtl] .deleteButton {
	left: 0px;
	right: auto;
}

body[dir=rtl] .cleanButton {
	left: 0;
	right: auto;
}

body[dir=rtl] .closeButton {
	right: 0;
	left: auto;
	/* Mirror the back button so it points in the correct direction in RTL */
	-moz-transform: scaleX(-1);
	-webkit-transform: scaleX(-1);
	transform: scaleX(-1);
}

body[dir=rtl] .titlebarItem {
	padding-left: auto;
	padding-right: 32px;
}
